using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.HomeServer.SDK.Interop.v1;

namespace WhsFacebook.Whs
{
    public abstract class UserAccount
    {
        private string _domainName;

        public abstract string UserNameOnly
        {
            get;
        }

        public string UserName
        {
            get { return (Environment.MachineName + "\\" + this.UserNameOnly); }
        }

        public virtual string FullName
        {
            get { return this.UserNameOnly; }
        }

        public string EmailAddress
        {
            get
            {
                if (string.IsNullOrEmpty(_domainName))
                {
                    return (this.UserNameOnly + "@" + Environment.MachineName);
                }
                else
                {
                    return (this.UserNameOnly + "@" + _domainName);
                }
            }
        }

        protected UserAccount()
        {
            var info = new WHSInfoClass();

            info.Init(Properties.Constants.ApplicationName);

            _domainName = info.GetDomainName();
        }
    }
}
